#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin >> s;
    int x = 0, y = 0;
    for (int i = 0; i < s.length(); i++) {
        switch (s[i]) {
        case 'U':x -= 1; break;
        case 'D':x += 1; break;
        case 'L':y -= 1; break;
        case 'R':y += 1; break;
        }
    }
    cout << x << " " << y;
    return 0;
}